#!/usr/bin/python
# -*- coding: UTF-8 -*-
from bisect import *
def index(a, x):
    '定位最左边的值等于x的元素的下标'
    i = bisect_left(a, x)
    if i != len(a) and a[i] == x:
        return i
    raise ValueError

